
package com.showcai.controller.applyMaintain;

import com.github.pagehelper.PageInfo;
import com.showcai.controller.base.BaseController;
import com.showcai.def.Constant;
import com.showcai.module.ApplyMaintain;
import com.showcai.service.ApplyMaintainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * Created by lutao on 2017/7/14.
 */
@RequestMapping("/applyMaintain")
@Controller
public class ApplyMaintainController extends BaseController {

    @Autowired
    ApplyMaintainService applyMaintainService;

    /**
     * 获取意见反馈
     * @return
     */
    @RequestMapping(value = "/applyMaintainList")
    @ResponseBody
    public ModelAndView feeBackList(Integer page, Integer pageSize) {
        ModelAndView mov = new ModelAndView();
        if (page == null || page == 0) {
            page = Constant.PAGENUM;
        }
        // 设置每页记录数
        if (pageSize == null || pageSize == 0) {
            pageSize = Constant.PAGESIZENum;
        }
        PageInfo<ApplyMaintain> list = applyMaintainService.getApplyMaintainList(page,pageSize);
        mov.setViewName("applyMaintain/applyMaintainList");
        mov.addObject("applyMaintainList",list);
        return mov;
    }



}
